package com.example.chat2.dao;

import com.example.chat2.domain.TbUserinfo;

import com.example.chat2.vo.AuthUserVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;








public interface UserinfoMapper  extends Mapper<TbUserinfo> {

    @Select("SELECT * FROM schoolchat")
    List<TbUserinfo> selectAll();


    @Select("SELECT * FROM schoolchat WHERE id = #{id}")
    TbUserinfo selectByPrimaryKey1(@Param("id") Long id);


    @Select("SELECT\n" +
            "  u.id,\n" +
            "  u.username,\n" +
            "  u.PASSWORD \n" +
            "FROM\n" +
            "  schoolchat u\n" +
            "WHERE\n" +
            "  username = #{username} \n" +
            "  AND PASSWORD = #{password}")
    TbUserinfo selectByUserAndPassword(AuthUserVo authUserVo) ;



}
